/* Copyright 2007-2008 dnAnalytics Project.
 *
 * Contributors to this file:
 * Marcus Cuda - http://marcus.cuda.net
 *
 * This file is part of dnAnalytics.  dnAnalytics is licensed under the 
 * Microsoft Public License. See License.txt for a complete copy of the
 * license.
 */

namespace dnAnalytics.LinearAlgebra.Decomposition
{
    internal partial class DenseSvd
    {
        private bool Decompose()
        {
            int info;
            if (mComputeVectors)
            {
                info = SafeNativeMethods.d_svd_factor(mComputeVectors, mRows, mColumns, mMatrix, ((DenseVector) mS).Data, ((DenseMatrix) mU).Data, ((DenseMatrix) mV).Data);
            }else
            {
                info = SafeNativeMethods.d_svd_factor(mComputeVectors, mRows, mColumns, mMatrix, ((DenseVector)mS).Data, null, null);
            }
            return info == 0;
        }
    }
}